package com.luoqiz.demo.threadDemo;

public class MyThread extends Thread{

	private String name;
	public MyThread(){}
	public MyThread(String name){
		this.name=name;
	}
	public void run(){
		for(int i=0;i<10;i++){
			System.out.println(name+"--"+i);
			//当前线程瞬时释放cpu
			Thread.yield();
			try {
				Thread.sleep(1000);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
		
	}
}
